package io.github.weiranyi.listener;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.listener.adapter.AbstractAdaptableMessageListener;

public class FanoutListener extends AbstractAdaptableMessageListener {
    @Override
    public void onMessage(Message message, Channel channel) throws Exception {
        System.out.println("msg："+new String(message.getBody()));

        long msgId = message.getMessageProperties().getDeliveryTag();
        channel.basicAck(msgId, true);
        System.out.println("-------------------------------------");
    }


}
